The Universal Serial Bus (USB) is a serial bus standard that supports data exchange between a host computer and a plurality of simultaneously accessible devices such as peripherals which may be external to the host computer. USB devices include human interface devices, for example, mouse, keyboard, tablet and game controller, imaging devices, for example, scanner, printer and camera and storage devices, for example, Compact-Disk Read Only Memory (CD-ROM), floppy drive and Digital Video Disk (DVD).
A USB host initiates all data transfers to/from the USB devices accessible via the physical USB. A data transfer (transaction) is initiated when the host controller sends a USB packet that identifies the type and direction of the data transfer, the address of the USB device and an endpoint number in the device. An endpoint is a uniquely identifiable portion of a USB device that is the terminus of a communication flow between the USB host and the USB device. The endpoint direction may be IN (to host) or OUT (from host).
Data and control exchange between the USB host and the USB device is supported as a set of either unidirectional or bidirectional logical pipes. A logical pipe is a logical abstraction between the USB host and an endpoint in a USB device to exchange data and control packets between the USB host and the USB device. The USB device may transfer data over a plurality of logical pipes (pipe bundle) to a host, for example, there may be a separate unidirectional logical pipe for transporting data to an OUT endpoint in the USB device and another unidirectional logical pipe for transporting data to the USB host from an IN endpoint in the USB device.
Command sets from existing industry-standard storage protocols may be used to communicate between a USB host and a mass storage class USB device, for example, the Small Computer System Interface (SCSI) protocol. The SCSI protocol is a set of standards for transferring data between host systems and devices, such as, storage devices. SCSI defines communication between an initiator (for example, a host) and a target (for example, a device), with the initiator sending a command to the target. SCSI commands are sent from the initiator to the target encoded in a Command Descriptor Block (CDB). The CDB includes an operation code and command-specific parameters. The SCSI commands include read commands and write commands. After completion of a data transfer (for example, a transfer of write data to the target or a transfer of read data to the initiator), the target returns a status code indicating whether the command was successfully completed.
USB communicates with mass storage class USB devices by encapsulating SCSI commands in a USB wrapper (header) of a USB packet. For example, the command sets used by the USB host may be those defined by SCSI Primary Commands-2 (SPC-2).
A pair of unidirectional logical pipes are configured for transferring the SCSI CDB, SCSI status code and the data exchanged between the host and the mass storage class USB device. An IN pipe (between an endpoint in the USB device and the USB host) is configured to transfer data and command to the device. An OUT pipe (between the endpoint in the USB device and the USB host) is configured to transfer data and status from the device to the USB host. Each of the logical pipes is associated with a logical buffer in the host (initiator) for storing data to be transferred over the USB.
Although the following Detailed Description will proceed with reference being made to illustrative embodiments of the claimed subject matter, many alternatives, modifications, and variations thereof will be apparent to those skilled in the art. Accordingly, it is intended that the claimed subject matter be viewed broadly, and be defined only as set forth in the accompanying claims.